@echo off
echo [INIT] Initializing...
X:\Windows\System32\wpeinit.exe

:: Give it a long 20s pause to ensure letters are assigned
ping -n 20 127.0.0.1 >nul

title 25H2 TARGETED DEPLOYER
color 17

:: Check only the most likely candidates
set "DRV="
if exist D:\Bypass.cmd set "DRV=D"
if exist E:\Bypass.cmd set "DRV=E"
if exist H:\Bypass.cmd set "DRV=H"

:: If still not found, search the rest as a fallback
if "%DRV%"=="" (
    echo [WAIT] Checking other drives...
    for %%d in (F G I J K L M N) do (
        if exist %%d:\Bypass.cmd set "DRV=%%d"
    )
)

:: THE REBOOT PREVENTER
if "%DRV%"=="" (
    color 4F
    echo [!] FATAL: Bypass.cmd not found on D, E, or H.
    echo [!] Use 'diskpart' > 'list volume' to find the letter.
    cmd.exe /k
)

echo [SUCCESS] Found NTFS Partition on Drive %DRV%:
call %DRV%:\Bypass.cmd

cd /d %DRV%:\sources
setup.exe /installfrom:%DRV%:\sources\install.wim

:: Prevent reboot on exit
cmd.exe /k